import java.io.*;

public class Demo12 {
    public static void main(String[] args) {
        try(OutputStream outputStream = new FileOutputStream("C:\\Download\\text.txt"))
        {
            //相当去把字节流转成字符流
            PrintWriter writer = new PrintWriter(outputStream);
            writer.println("hello");
            writer.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
